import matplotlib.pyplot as plt
 
def draw_grid(n):
    fig, ax = plt.subplots()
    ax.set_xticks(range(n+1))
    ax.set_yticks(range(n+1))
    ax.grid(True, linestyle='--', linewidth=0.5, color='gray')
    plt.xlim(0, n)
    plt.ylim(0, n)
    plt.show()
 
draw_grid(10)